package topcoder;

public class TwiceString {

	public String getShortest(String s){
		boolean match = false;
		int i;
		int N = s.length();
		for(i = 1; i < N; i++){
			match = true;
			for(int j = 0; j < N-i; j++){
				if(s.charAt(i+j) != s.charAt(j)){
					match = false;
					break;
				}
			}
			if(match)
				break;
		}
		if(match)
			return s + s.substring(N-i);
		else
			return s + s;
	}
}
